package cn.xm.org.enu;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import org.apache.velocity.runtime.directive.Foreach;

@Getter
@AllArgsConstructor
public enum ShopStateEnum {

    WAIT_AUDIT(0,"待审核"),
    HAVE_AUDIT(1,"已审核"),
    PASS(2,"已激活"),
    REJECT(-1,"驳回");

    private Integer code;
    private String name;

    public static String getNameByCode(Integer code) {
        for (ShopStateEnum shopStateEnum:ShopStateEnum.values()) {
            if (shopStateEnum.getCode() == code) {
                return shopStateEnum.getName();
            }
        }
        return "";
    }
}
